<?php 
    class Areas extends CI_Model{

        function __construct(){
            parent::__construct();
        }

        function get_province_data($parent_code = 0){
            $sql = "SELECT area_name, area_code FROM {$this->db->dbprefix}areas WHERE parent_code = $parent_code";
            $result = $this->db->query($sql)->result_array();
            return $result;
        }
    }